package com.ruoyi.demo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.AuctionUserAddressMapper;
import com.ruoyi.demo.domain.AuctionUserAddress;
import com.ruoyi.demo.service.IAuctionUserAddressService;

/**
 * 用户地址Service业务层处理
 * 
 * @author metaee
 * @date 2025-02-24
 */
@Service
public class AuctionUserAddressServiceImpl implements IAuctionUserAddressService 
{
    @Autowired
    private AuctionUserAddressMapper auctionUserAddressMapper;

    /**
     * 查询用户地址
     * 
     * @param addressId 用户地址主键
     * @return 用户地址
     */
    @Override
    public AuctionUserAddress selectAuctionUserAddressByAddressId(Long addressId)
    {
        return auctionUserAddressMapper.selectAuctionUserAddressByAddressId(addressId);
    }

    /**
     * 查询用户地址列表
     * 
     * @param auctionUserAddress 用户地址
     * @return 用户地址
     */
    @Override
    public List<AuctionUserAddress> selectAuctionUserAddressList(AuctionUserAddress auctionUserAddress)
    {
        return auctionUserAddressMapper.selectAuctionUserAddressList(auctionUserAddress);
    }

    /**
     * 新增用户地址
     * 
     * @param auctionUserAddress 用户地址
     * @return 结果
     */
    @Override
    public int insertAuctionUserAddress(AuctionUserAddress auctionUserAddress)
    {
        auctionUserAddress.setCreateTime(DateUtils.getNowDate());
        return auctionUserAddressMapper.insertAuctionUserAddress(auctionUserAddress);
    }

    /**
     * 修改用户地址
     * 
     * @param auctionUserAddress 用户地址
     * @return 结果
     */
    @Override
    public int updateAuctionUserAddress(AuctionUserAddress auctionUserAddress)
    {
        auctionUserAddress.setUpdateTime(DateUtils.getNowDate());
        return auctionUserAddressMapper.updateAuctionUserAddress(auctionUserAddress);
    }

    /**
     * 批量删除用户地址
     * 
     * @param addressIds 需要删除的用户地址主键
     * @return 结果
     */
    @Override
    public int deleteAuctionUserAddressByAddressIds(Long[] addressIds)
    {
        return auctionUserAddressMapper.deleteAuctionUserAddressByAddressIds(addressIds);
    }

    /**
     * 删除用户地址信息
     * 
     * @param addressId 用户地址主键
     * @return 结果
     */
    @Override
    public int deleteAuctionUserAddressByAddressId(Long addressId)
    {
        return auctionUserAddressMapper.deleteAuctionUserAddressByAddressId(addressId);
    }
}
